package zero.mybatisplus.dynamictable.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import zero.mybatisplus.dynamictable.annotation.DynamicTable;
import zero.mybatisplus.dynamictable.emnus.TypeEnums;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

import java.sql.Timestamp;

@Getter
@Setter
@TableName("t_zero")
@DynamicTable(type = TypeEnums.YEAR_MONTH_TABLE, dateField = "date")
public class ZeroEntity extends Model<ZeroEntity> {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    private String name;

    @TableField(jdbcType = JdbcType.DATE)
    private Timestamp date;
}
